<!--

 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div class="pptist-editor">
    <EditorHeader class="layout-header" />
    <div class="layout-content">
      <!-- 左侧 -->
      <Thumbnails class="layout-content-left" />
      <div class="layout-content-center">
        <!-- 顶部图标 -->
        <!-- <CanvasTool class="center-top" /> -->
        <!-- 中间画布 -->
        <Canvas class="center-body" :style="{  height: `calc(100% - ${remarkHeight + 40}px)` }" />
        <!-- <Remark
          class="center-bottom" 
          v-model:height="remarkHeight" 
          :style="{ height: `${remarkHeight}px` }"
        /> -->
        <el-row style="min-width: 1000px;">
          <el-col :span="24">
            <div class="page-number" style="text-align: center; width: 100%; height: 100px; line-height: 100px;">
              场景{{ slideIndex + 1 }}: 场景 0000000{{ slideIndex + 1 }}</div>
          </el-col> 
        </el-row>
      </div>
      <Toolbar class="layout-content-right" />
    </div>
  </div>
  <SelectPanel v-if="showSelectPanel" />
  <Modal :visible="!!dialogForExport" :footer="null" centered :closable="false" :width="680" destroyOnClose
    @cancel="closeExportDialog()">
    <ExportDialog />
  </Modal>
</template> 
<script lang="ts" setup>
import { ref } from 'vue'
import { storeToRefs } from 'pinia'
import { useMainStore, useSlidesStore } from '@/store'
import useGlobalHotkey from '@/hooks/useGlobalHotkey'
import usePasteEvent from '@/hooks/usePasteEvent'
const slidesStore = useSlidesStore();
const { slides, slideIndex } = storeToRefs(slidesStore);
import EditorHeader from './EditorHeader/index.vue'
import Canvas from './Canvas/index.vue'
import CanvasTool from './CanvasTool/index.vue'
import Thumbnails from './Thumbnails/index.vue'
import Toolbar from './Toolbar/index.vue'
import Remark from './Remark/index.vue'
import ExportDialog from './ExportDialog/index.vue'
import SelectPanel from './SelectPanel.vue'
import { Modal } from 'ant-design-vue'
slidesStore.$reset()
const mainStore = useMainStore()
const { dialogForExport, showSelectPanel,canvasHeight1 } = storeToRefs(mainStore)
const closeExportDialog = () => mainStore.setDialogForExport('')

const remarkHeight = ref(40)

useGlobalHotkey()
usePasteEvent()
</script>

<style lang="scss" scoped>
.pptist-editor {
  height: 100%;

}

.layout-header {
  height: 50px;

}

.layout-content {
  height: calc(100% - 40px);
  display: flex;
}

.layout-content-left {
  width: 260px !important;
  height: 100%;
  // flex-shrink: 0;

}
.layout-content-center {
  width: calc(100% - 160px - 260px);
  .center-top {
    height: 40px;
  }
}
.layout-content-right {

  width: 20%;
  height: 100%;
}
</style>